//
//  promptView.m
//  家盟商城
//
//  Created by 李志权 on 2016/11/26.
//  Copyright © 2016年 李志权. All rights reserved.
//

#import "promptView.h"

@implementation promptView
- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        self = [[[NSBundle mainBundle]loadNibNamed:@"promptView" owner:self options:nil] lastObject];
        self.backgroundColor = [UIColor colorWithWhite:0 alpha:0.5];
        [self.aView setShearRound:5 masksToBounds:YES borderWidth:0 borderColor:nil];
        self.frame = frame;
        UIWindow *window = [[UIApplication sharedApplication]keyWindow];
        [window addSubview:self];
        [UIView animateWithDuration:0.25 animations:^{
            self.Y = 0;
        }];
    }
    return self;
}
- (IBAction)cancelBtnClick:(id)sender {
    [UIView animateWithDuration:0.25 animations:^{
        self.Y = Height;
    } completion:^(BOOL finished) {
        [self removeFromSuperview];
    }];
}

@end
